package com.wms.consumer.controller;

import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.Message;
import org.springframework.messaging.support.MessageBuilder;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Description: TODO 消费者接收消息 - 测试
 *
 * @version 1.0
 * @author: wangqiang
 * @date: 2023/3/12 23:41
 */
@Component
@Slf4j
// 消费者监听器通过selectorExpression ="tagName"获取指定的TAG消息 ,需要获取多个tag时，使用||分隔："a||b||c"
@RocketMQMessageListener(topic = "test_topic",consumerGroup = "test_group")
public class TestConsumer implements RocketMQListener<String> {

    @Override
    public void onMessage(String s) {
        log.info("消费者接收的消息...{}",s);
    }
}
